﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace RAMED
{
    public partial class TraitementForm : Form
    {
        private Demande_litigieuses dl = new Demande_litigieuses();
        public Demande_litigieuses DL
        {
            get { return dl; }
            set { dl = value; }
        }
        public TraitementForm()
        {
            InitializeComponent();
            RAMEDEntities1 Context = SingletonContext.GetContext();
        }

        private void TraitementForm_Load(object sender, EventArgs e)
        {

        }

        internal void InitialiserChamps()
        {
            
        }
        public RechercheDemandeForm Recherchedemendeform { get; set; }


        private void btnAjouter_Click(object sender, EventArgs e)
        {
            RAMEDEntities1 Context = SingletonContext.GetContext();
            Traitement traitajoute = new Traitement();
           
            traitajoute.description_traitement = txtdis.Text;
            traitajoute.date_traitement = dateTimePickertrait.Value;
            traitajoute.Demande_litigieuses = dl;

            Context.Traitements.AddObject(traitajoute);
            Context.SaveChanges();
            this.Dispose();

            
        }
        

        private void button2_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void Button21_Click(object sender, EventArgs e)
        {
            this.WindowState = FormWindowState.Minimized;
        }

    }
}
